

//聊天内容表，要和用户表一一对应，存放聊天记录，好友关系
const { Sequelize, DataTypes } = require("sequelize")

import { seq } from "../db"
export const Chat = seq.define("chat", {
    userId: {
        type: DataTypes.INTEGER,
        allowNull: false,
        comment: "唯一外键，对应user的id"
    },
    friend: {
        type: DataTypes.INTEGER,
        allowNull: false,
        comment: "好友或存在聊天关系"
    },
    content: {
        type: DataTypes.TEXT,
        allowNull: true,
        comment: "聊天内容"
    },
    status: {
        type: DataTypes.BOOLEAN,
        allowNull: false,
        defaultValue: true,
        comment: "true代表存在，false已删除"
    }
})